Skip to content

Cleaned up public app release scripts#29414

Merged
acburdine merged 1 commit into
mainfrom
feat/scripts-cleanup-pt2
Jul 17, 2026
Merged

Cleaned up public app release scripts#29414
acburdine merged 1 commit into
mainfrom
feat/scripts-cleanup-pt2

Conversation

@acburdine

Copy link
Copy Markdown
Member

ref https://linear.app/ghost/issue/PLA-235/consolidate-ci-scripts-into-monorepo-package

  • convert public app-related scripts to esm
  • simplify public-apps and infer cdn paths from defaults.json
  • dedupe code
  • remove unnecessary changelog generation for public app commits

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Public app automation now uses ESM entrypoints and shared metadata utilities. CDN purge matrices derive URLs from defaults.json, release commands update app and defaults versions before committing, and version-bump checks use shared app descriptors. CI invokes the new scripts with required dependencies, ship commands point to the new release runner, and Node test coverage plus script documentation were added.

Possibly related PRs

  • TryGhost/Ghost#29410: Modifies related CI and release-script wiring for the same public-app automation.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: cleanup of the public app release scripts.
Description check ✅ Passed The description clearly matches the changes by mentioning ESM conversion, public-app simplification, deduping, and changelog removal.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/scripts-cleanup-pt2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 17, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit e198bae

Command Status Duration Result
nx run ghost:test:integration ✅ Succeeded 2m 59s View ↗
nx run ghost:test:ci:integration ✅ Succeeded 4s View ↗
nx run @tryghost/admin:test:acceptance ✅ Succeeded 5m 27s View ↗
nx run ghost:test:legacy ✅ Succeeded 2m 55s View ↗
nx run ghost:test:e2e ✅ Succeeded 2m 39s View ↗
nx run @tryghost/koenig-lexical:test:acceptance ✅ Succeeded 2m 28s View ↗
nx run @tryghost/comments-ui:test:acceptance ✅ Succeeded 40s View ↗
nx run @tryghost/activitypub:test:acceptance ✅ Succeeded 41s View ↗
Additional runs (8) ✅ Succeeded ... View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-17 18:06:24 UTC

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/check-app-version-bump.js`:
- Line 171: Replace the import.meta.main guard in the script entrypoint with a
Node.js-version-compatible check so the app-version consistency validation
always runs when executed directly, including on versions before 21.2.0. Keep
the existing check logic unchanged and avoid relying on import.meta.main.

In `@scripts/release-apps.js`:
- Around line 77-83: Update updatePackageJson to pass 4 as the JSON.stringify
indentation argument when writing package.json, preserving the repository’s
existing formatting and avoiding unrelated reformatting.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: beaafa74-da4e-43aa-b038-739eb01f93d4

📥 Commits

Reviewing files that changed from the base of the PR and between 9fa9458 and 0b47d92.

📒 Files selected for processing (17)
  • .github/workflows/ci.yml
  • apps/admin-toolbar/package.json
  • apps/announcement-bar/package.json
  • apps/comments-ui/package.json
  • apps/portal/package.json
  • apps/signup-form/package.json
  • apps/sodo-search/package.json
  • scripts/README.md
  • scripts/build-public-apps-matrix.cjs
  • scripts/build-public-apps-matrix.js
  • scripts/check-app-version-bump.js
  • scripts/lib/public-apps.js
  • scripts/public-apps.json
  • scripts/release-apps.cjs
  • scripts/release-apps.js
  • scripts/test/build-public-apps-matrix.test.js
  • scripts/test/public-apps.test.js
💤 Files with no reviewable changes (2)
  • scripts/build-public-apps-matrix.cjs
  • scripts/release-apps.cjs

Comment thread scripts/check-app-version-bump.js
Comment thread scripts/release-apps.js
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.28%. Comparing base (e089585) to head (7a68445).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #29414      +/-   ##
==========================================
- Coverage   74.32%   74.28%   -0.04%     
==========================================
  Files        1597     1597              
  Lines      139677   139677              
  Branches    16963    16949      -14     
==========================================
- Hits       103812   103763      -49     
- Misses      34846    34863      +17     
- Partials     1019     1051      +32     
Flag Coverage Δ
e2e-tests 76.35% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@acburdine
acburdine force-pushed the feat/scripts-cleanup-pt2 branch from 0b47d92 to b8db993 Compare July 17, 2026 02:23

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
scripts/check-app-version-bump.js (1)

154-161: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Avoid redundant file reads by extracting variables.

Currently, getPrVersion and getPrDefaultsVersion are called twice per app (once for the consistency check and once for the console log). Each call synchronously reads and parses package.json or defaults.json. Storing the results in local variables improves readability and avoids redundant I/O operations.

♻️ Proposed refactor
-        const error = checkAppConsistency(app, getPrVersion(app), getPrDefaultsVersion(app));
+        const prVersion = getPrVersion(app);
+        const prDefaultsVersion = getPrDefaultsVersion(app);
+        const error = checkAppConsistency(app, prVersion, prDefaultsVersion);

         if (error) {
             failedApps.push(error);
             continue;
         }

-        console.log(`${app.configKey} version consistency check passed (package.json ${majorMinor(getPrVersion(app))} = defaults.json ${getPrDefaultsVersion(app)})`);
+        console.log(`${app.configKey} version consistency check passed (package.json ${majorMinor(prVersion)} = defaults.json ${prDefaultsVersion})`);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/check-app-version-bump.js` around lines 154 - 161, In the app
consistency-check loop, update the flow around checkAppConsistency to store
getPrVersion(app) and getPrDefaultsVersion(app) results in local variables, then
reuse those variables for both the consistency check and success log. Preserve
the existing error handling and log output.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@scripts/check-app-version-bump.js`:
- Around line 154-161: In the app consistency-check loop, update the flow around
checkAppConsistency to store getPrVersion(app) and getPrDefaultsVersion(app)
results in local variables, then reuse those variables for both the consistency
check and success log. Preserve the existing error handling and log output.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 61a8373f-ca53-4d78-8e5b-60a346aef5c2

📥 Commits

Reviewing files that changed from the base of the PR and between 0b47d92 and b8db993.

📒 Files selected for processing (20)
  • .github/workflows/ci.yml
  • apps/admin-toolbar/package.json
  • apps/announcement-bar/package.json
  • apps/comments-ui/package.json
  • apps/portal/package.json
  • apps/signup-form/package.json
  • apps/sodo-search/package.json
  • scripts/README.md
  • scripts/build-public-apps-matrix.cjs
  • scripts/build-public-apps-matrix.js
  • scripts/check-app-version-bump.js
  • scripts/lib/public-apps.js
  • scripts/lib/release-notes.js
  • scripts/lib/resolve-base-tag.js
  • scripts/lib/utils.js
  • scripts/public-apps.json
  • scripts/release-apps.cjs
  • scripts/release-apps.js
  • scripts/test/build-public-apps-matrix.test.js
  • scripts/test/public-apps.test.js
💤 Files with no reviewable changes (2)
  • scripts/build-public-apps-matrix.cjs
  • scripts/release-apps.cjs
🚧 Files skipped from review as they are similar to previous changes (10)
  • apps/signup-form/package.json
  • apps/sodo-search/package.json
  • apps/comments-ui/package.json
  • apps/portal/package.json
  • scripts/build-public-apps-matrix.js
  • scripts/test/public-apps.test.js
  • apps/announcement-bar/package.json
  • apps/admin-toolbar/package.json
  • scripts/release-apps.js
  • scripts/test/build-public-apps-matrix.test.js

@acburdine
acburdine force-pushed the feat/scripts-cleanup-pt2 branch 2 times, most recently from b717d36 to e198bae Compare July 17, 2026 17:38

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
scripts/lib/public-apps.js (1)

39-40: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider throwing an explicit error if the app is not found.

If an unrecognized package name is passed, find will return undefined. This will cause downstream code (such as the release runner) to throw a generic TypeError (e.g., Cannot read properties of undefined (reading 'configKey')) when it tries to access properties on the result. Throwing an explicit error here can improve debugging.

♻️ Proposed refactor
-/** `@param` {string} packageName */
-export const appForPackageName = packageName => PUBLIC_APPS.find(app => app.packageName === packageName);
+/** `@param` {string} packageName */
+export const appForPackageName = packageName => {
+    const app = PUBLIC_APPS.find(a => a.packageName === packageName);
+    if (!app) {
+        throw new Error(`App "${packageName}" not found in public-apps.json`);
+    }
+    return app;
+};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/lib/public-apps.js` around lines 39 - 40, Update appForPackageName to
detect when PUBLIC_APPS.find returns no match and throw a descriptive error that
includes the unrecognized packageName; preserve returning the matched app
unchanged for valid package names.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@scripts/lib/public-apps.js`:
- Around line 39-40: Update appForPackageName to detect when PUBLIC_APPS.find
returns no match and throw a descriptive error that includes the unrecognized
packageName; preserve returning the matched app unchanged for valid package
names.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fcbc186d-674a-457a-a0a3-2134cb594fd6

📥 Commits

Reviewing files that changed from the base of the PR and between b717d36 and e198bae.

📒 Files selected for processing (23)
  • .github/workflows/ci.yml
  • apps/admin-toolbar/package.json
  • apps/announcement-bar/package.json
  • apps/comments-ui/package.json
  • apps/portal/package.json
  • apps/signup-form/package.json
  • apps/sodo-search/package.json
  • scripts/README.md
  • scripts/build-public-apps-matrix.cjs
  • scripts/build-public-apps-matrix.js
  • scripts/check-app-version-bump.js
  • scripts/lib/constants.js
  • scripts/lib/public-apps.js
  • scripts/lib/release-notes.js
  • scripts/lib/resolve-base-tag.js
  • scripts/lib/utils.js
  • scripts/public-apps.json
  • scripts/release-apps.cjs
  • scripts/release-apps.js
  • scripts/release.cjs
  • scripts/test/build-public-apps-matrix.test.js
  • scripts/test/public-apps.test.js
  • scripts/test/resolve-base-tag.test.cjs
💤 Files with no reviewable changes (2)
  • scripts/build-public-apps-matrix.cjs
  • scripts/release-apps.cjs
🚧 Files skipped from review as they are similar to previous changes (13)
  • apps/sodo-search/package.json
  • apps/comments-ui/package.json
  • apps/announcement-bar/package.json
  • apps/portal/package.json
  • scripts/test/resolve-base-tag.test.cjs
  • apps/signup-form/package.json
  • scripts/release.cjs
  • scripts/public-apps.json
  • scripts/build-public-apps-matrix.js
  • scripts/test/public-apps.test.js
  • scripts/README.md
  • scripts/test/build-public-apps-matrix.test.js
  • scripts/release-apps.js

@acburdine
acburdine force-pushed the feat/scripts-cleanup-pt2 branch from e198bae to 64be978 Compare July 17, 2026 17:44
ref https://linear.app/ghost/issue/PLA-235/consolidate-ci-scripts-into-monorepo-package
- convert public app-related scripts to esm
- simplify public-apps and infer cdn paths from defaults.json
- dedupe code
- remove unnecessary changelog generation for public app commits
@acburdine
acburdine force-pushed the feat/scripts-cleanup-pt2 branch from 64be978 to 7a68445 Compare July 17, 2026 17:57
@acburdine
acburdine merged commit 6e15b9d into main Jul 17, 2026
50 checks passed
@acburdine
acburdine deleted the feat/scripts-cleanup-pt2 branch July 17, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant